const multer = require('multer')
let storage = multer.diskStorage({
    /*1上传的文件放到哪里去*/
    destination(req,file,cb){
        cb(null,'public/upload')
    },
    /*2重命名上传的文件*/
    filename(req,file,cb){
        cb(null,Date.now()+'-'+file.originalname)
    }
})
const upload = multer({storage})
module.exports = upload